Conventionally, in an international standard video encoding system, such as MPEG or ITU-T H.26x, a method of defining block data (referred to as “macroblock” from here on) as a unit, the block data being a combination of 16×16 pixels of brightness signal and 8×8 pixels of color difference signal corresponding to the 16×16 pixels of brightness signal, and compressing each frame of a video signal in units of block data in accordance with a motion compensation technique, and an orthogonal transformation/transform coefficient quantization technique is used.
The motion compensation technique is used to reduce the redundancy of a signal in a time direction for each macroblock by using a high correlation existing between video frames. In accordance with this motion compensation technique, an already-encoded frame which has been previously encoded is stored in a memory as a reference image, and a block area which provides the smallest difference in electric power between the block area itself and the current macroblock which is a target block for the motion-compensated prediction is searched for through a search range predetermined in the reference image, and a spatial displacement between the spatial position of the current macroblock and the spatial position of the block area in the reference image which is determined as the result of the search is then encoded as a motion vector.
Further, in accordance with the orthogonal transformation/transform coefficient quantization technique, a differential signal which is acquired by subtracting a prediction signal acquired as the result of the above-mentioned motion-compensated prediction from the current macroblock is orthogonal transformed and quantized so that the amount of information is compressed.
In the case of MPEG-4 Visual, each block which is used as a unit for motion-compensated prediction has a minimum size of 8×8 pixels, and DCT (discrete cosine transform) having a 8×8 pixel size is used also for orthogonal transformation. In contrast with this, in the case of (ITU-T H.264) MPEG-4 AVC (Moving Picture Experts Group-4 Advanced Video Coding), a motion-compensated prediction with a block size smaller than 8×8 pixels is prepared in order to efficiently carry out encoding on even an area, such as a boundary between objects, having a small correlation between pixels in a spatial direction. Further, in the orthogonal transformation, the compression and encoding can be carried out by adaptively switching between 8×8-pixel DCT having integer pixel accuracy and 4×4-pixel DCT having integer pixel accuracy on a per-macroblock basis.
In accordance with such a conventional international standard video image encoding method, particularly when the resolution of the image becomes higher resulting from the macroblock size being fixed, an area which is covered by each macroblock is easily localized because the macroblock size is fixed. As a result, there occurs a case in which a peripheral macroblock is placed in the same encoding mode or the same motion vector is allocated to a peripheral macroblock. In such a case, because the overhead of encoding mode information, motion vector information and so on which are encoded even though the prediction efficiency is not improved increases, the encoding efficiency of the entire encoder is reduced.
To solve such a problem, a device which switches between macroblock sizes in accordance with the resolution or the contents of an image is disclosed (for example, refer to patent reference 1). The moving image encoding device disclosed by patent reference 1 can carry out compression and encoding by switching between selectable orthogonal transformation block sizes or between selectable sets of orthogonal transformation block sizes in accordance with the macroblock size.